#include<iostream>
#include<string>
using namespace std;

int main()
{
    string s;
    getline(cin, s);
    size_t pos = s.rfind(' ');
    if (pos != string::npos)
    {
        string tmp = s.substr(pos);
        cout << s.size() - pos - 1 << endl;
    }
    else
    {
        cout << s.size();
    }
    return 0;
}